package com.ict.web.dto;


import com.ict.common.utils.DateUtils;
import com.ict.common.utils.bean.BeanUtils;
import com.ict.common.utils.uuid.IdUtils;
import com.ict.web.domain.OrganizationManagement;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class InsertOrganizationManagementDto {


  /** 机构名称 */
  @ApiModelProperty(value = "机构名称")
  private String organizationName;

  /** 机构类型 */
  @ApiModelProperty(value = "机构类型")
  private String organizationType;

  /** 联系人 */
  @ApiModelProperty(value = "联系人")
  private String contacts;

  /** 联系电话 */
  @ApiModelProperty(value = "联系电话")
  private String contactNumber;

  /** 传真 */
  @ApiModelProperty(value = "传真")
  private String fax;

  /** 联系地址 */
  @ApiModelProperty(value = "联系地址")
  private String address;

  public static OrganizationManagement of(InsertOrganizationManagementDto dto){
    OrganizationManagement bean = new OrganizationManagement();
    BeanUtils.copyProperties(dto,bean);
    //设置ID
    bean.setOrmId(IdUtils.snowId());
    //设置创建时间
    bean.setCreateTime(DateUtils.getNowDate());
    //设置更新时间
    bean.setUpdateTime(DateUtils.getNowDate());
    //设置物理删除标记
    bean.setIsDelete(OrganizationManagement.DELETE_STATUS_NORMAL);

    return bean;
  }
}